//
//  MineMethodView.swift
//  AirlineReservation
//
//  Created by Kevin on 2020/1/27.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class MineMethodView: UIButton {
    
    // View相关
    private lazy var picView = UIImageView(image: UIImage(named: "debitcardapply_24x24"))
    private lazy var labelView = UILabel(title: "测试", color: COLOR_NICE, size: 13, align: .center)
    
    // 赋值相关
    public var pic: String? {
        didSet {
            picView.image = UIImage(named: pic!)
        }
    }
    
    public var lable: String? {
        didSet {
            labelView.text = lable
        }
    }
    
    override func layoutSubviews() {
        // 图片
        let picX = (frame.width - MARGIN25) * 0.5
        picView.frame = CGRect(x: picX, y: MARGIN, width: MARGIN25, height: MARGIN25)
        addSubview(picView)
        // 提示
        
        let labelX = (frame.width - MARGIN60) * 0.5
        labelView.frame = CGRect(x: labelX, y: picView.frame.maxY + MARGIN10, width: MARGIN60, height: MARGIN)
        addSubview(labelView)
    }
}
